package com.itheima.bytewenti;

import java.io.UnsupportedEncodingException;
import java.util.Arrays;

public class Demo03 {

    public static void main(String[] args) throws UnsupportedEncodingException {
        String s="魑魅魍魉";
        byte[] bytes1 = s.getBytes();
        byte[] bytes2 = s.getBytes("gbk");
        System.out.println(Arrays.toString(bytes1));
        System.out.println(Arrays.toString(bytes2));


        System.out.println(new String(bytes1));
        System.out.println(new String(bytes2,"gbk"));

    }
}
